<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>修改皮肤</title>
		<style>
			*{
				padding:0;
				margin:0;
			}
			body{
				background: url(img/1.jpg) no-repeat;
			}
			.box1{
				height:170px;
				padding-top: 30px;
				text-align: center;
				background-color: rgba(255,255,255,0.3);
			}
			img{
				width:200px;
				margin:0 20px;
			}
		</style>
	</head>
	<body>
		<div class="box1">
			<img src="img/1.jpg" alt=""/>
			<img src="img/2.jpg" alt=""/>
			<img src="img/3.jpg" alt=""/>
			<img src="img/4.jpg" alt=""/>
			<img src="img/5.jpg" alt=""/>
		</div>
	</body>
	<script>
	var box=document.getElementsByTagName("div")[0];
	var body=document.body;
	var Arr=box.children;
	
	for(var i=0;i<Arr.length;i++){
		Arr[i].onclick = function(){
			body.style.backgroundImage = "url("+this.src+")";
		}
	}
		
	</script>
</html>
